<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/sql" prefix="sql"%>
<%@page import="model.Gebruiker;"%>

<head>
<title>Auction</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<link href="css/reset.css" rel="stylesheet" type="text/css" />
<link href="css/style.css" rel="stylesheet" type="text/css" />
</head>

<!-- begin body -->
<body>

	<!-- begin logo -->
	<div id="logo">
		<img class="logoimg" src="images/logo.png" alt="logo" />
	</div>
	<!-- end logo -->

	<!-- begin main -->
	<div class="main">

		<!-- begin auctionwrap -->
		<div class="auctionwrap">

			<%
				Gebruiker gebruiker = (Gebruiker) session.getAttribute("gebruiker");
				pageContext.setAttribute("gebruiker", gebruiker);
			%>

			<c:choose>
				<c:when test="${gebruiker!=null}">
					<div class="menu">
						<ul id="menuItems">
							<li><a href="./VeilingController">Home</a></li>
							<li><a
								href="./VeilingController?action=myAuctions">My
									Auctions</a></li>
							<li><a class="on" href="./VeilingController?action=myBids">My
									Bids</a></li>
							<li><a href="./EditProfileController">Edit profile</a></li>
							<li><a href="./InlogController?action=logout">Logout</a></li>

						</ul>
						<ul id="ingelogd"> <li> Logged in as: <b>
						<c:out value="${gebruiker.voornaam}"></c:out> <c:out value="${gebruiker.achternaam}"> </c:out></b>
						</li></ul>
					</div>
				</c:when>

				<c:otherwise>
					<div class="menu">
						<ul id="menuItems">
							<li><a class="on" href="./VeilingController">Home</a></li>
							<li><a href="./VeilingController?action=login">Login</a></li>
							<li><a href="./VeilingController?action=register">Register</a>
							</li>
						</ul>
					</div>
				</c:otherwise>
			</c:choose>




			<div class="auctions">
				<div id="biddedauctions">
					<h5>Items you bid on</h5>
					<c:forEach var="bod" items="${biedingen}" varStatus="status">

						<c:set var="bieder" value="${bod.bieder}"></c:set>
						<c:set var="veiling" value="${bod.veiling}"></c:set>

						<c:if test="${veiling.expired == false}">
							<c:choose>
								<c:when test="${veiling.highestBid == bod.prijs}">
									<div class="mybidsmyAuctiongreen">
								</c:when>
								<c:otherwise>
									<div class="mybidsmyAuctionred">
								</c:otherwise>
							</c:choose>

							<ul id="auctionInfo">
								<li><h5>
										<a
											href="./VeilingController?action=fullauction&veiling=${veiling.id}"><c:out
												value="${veiling.titel}">
											</c:out> </a>
									</h5></li>
								<li>Highest bid: <b><c:out
											value="${veiling.highestBid}"></c:out>&euro; </b>
								</li>
							</ul>
							<img class="mybidsauctionimg" src="${veiling.foto}" />
				</div>
				</c:if>
				</c:forEach>
			</div>


			<div id="wonauctions">
				<h5>Items you won</h5>
				<!-- begin auction overzicht -->
				<c:forEach var="bod" items="${gewonnen}" varStatus="status">
					<c:set var="bieder" value="${bod.bieder}"></c:set>
					<c:set var="veiling" value="${bod.veiling}"></c:set>



					<div class="mybidsmyAuction">
						<ul id="auctionInfo">
							<li><h5>
									<a
										href="./VeilingController?action=fullauction&veiling=${veiling.id}"><c:out
											value="${veiling.titel}">
										</c:out> </a>
								</h5></li>
							<li>Highest bid: <c:out value="${veiling.highestBid}"></c:out>&euro;
							</li>
						</ul>
						<img class="mybidsauctionimg" src="${veiling.foto}" />
					</div>
				</c:forEach>
			</div>
		</div>


	</div>


	</div>
	<!-- end main -->
</body>
<!-- // end body -->

</html>
